<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Jumper documentation</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>Jumper</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Class_Path_">Class Path </a></li>
</ul>


<h2>Modules</h2>
<ul>
  <li><a href="../modules/core.bheap.html">core.bheap</a></li>
  <li><a href="../modules/core.heuristics.html">core.heuristics</a></li>
  <li><a href="../modules/core.node.html">core.node</a></li>
  <li><strong>core.path</strong></li>
  <li><a href="../modules/grid.html">grid</a></li>
  <li><a href="../modules/pathfinder.html">pathfinder</a></li>
</ul>
<h2>Examples</h2>
<ul>
  <li><a href="../examples/annotatedpathing.lua.html">annotatedpathing.lua</a></li>
  <li><a href="../examples/customheuristics.lua.html">customheuristics.lua</a></li>
  <li><a href="../examples/makeclearance.lua.html">makeclearance.lua</a></li>
  <li><a href="../examples/simpleexample.lua.html">simpleexample.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>core.path</code></h1>

<p>The Path class.</p>
<p> The <a href="../modules/core.path.html">path</a>  class is a structure which represents a path (ordered set of nodes) from a start location to a goal.
 An instance from this class would be a result of a request addressed to <code>Pathfinder:getPath</code>.</p>

<p> This module is internally used by the library on purpose.
 It should normally not be used explicitely, yet it remains fully accessible.</p>

<h2><a href="#Class_Path_">Class Path </a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#Path:new">Path:new&nbsp;()</a></td>
	<td class="summary">Inits a new <a href="../modules/core.path.html">path</a> .</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Path:iter">Path:iter&nbsp;()</a></td>
	<td class="summary">Iterates on each single <a href="../modules/core.node.html">node</a>  along a <a href="../modules/core.path.html">path</a> .</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Path:nodes">Path:nodes&nbsp;()</a></td>
	<td class="summary">Iterates on each single <a href="../modules/core.node.html">node</a>  along a <a href="../modules/core.path.html">path</a> .</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Path:getLength">Path:getLength&nbsp;()</a></td>
	<td class="summary">Evaluates the <a href="../modules/core.path.html">path</a>  length</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Path:addNode">Path:addNode&nbsp;(node [, index])</a></td>
	<td class="summary">Counts the number of steps.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Path:fill">Path:fill&nbsp;()</a></td>
	<td class="summary"><a href="../modules/core.path.html#Class_Path">Path</a>  filling modifier.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Path:filter">Path:filter&nbsp;()</a></td>
	<td class="summary"><a href="../modules/core.path.html#Class_Path">Path</a>  compression modifier.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Path:clone">Path:clone&nbsp;()</a></td>
	<td class="summary">Clones a <a href="../modules/core.path.html">path</a> .</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Path:isEqualTo">Path:isEqualTo&nbsp;(p2)</a></td>
	<td class="summary">Checks if a <a href="../modules/core.path.html">path</a>  is equal to another.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Path:reverse">Path:reverse&nbsp;()</a></td>
	<td class="summary">Reverses a <a href="../modules/core.path.html">path</a> .</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Path:append">Path:append&nbsp;(p)</a></td>
	<td class="summary">Appends a given <a href="../modules/core.path.html">path</a>  to self.</td>
	</tr>
</table>

<br/>
<br/>


    <h2><a name="Class_Path_"></a>Class Path </h2>
    The <a href="../modules/core.path.html#Class_Path">Path</a>  class.<br/>
 This class is callable.
 Therefore, <em><code>Path(...)</code></em> acts as a shortcut to <em><code>Path:new(...)</code></em>.
    <dl class="function">
    <dt>
    <a name = "Path:new"></a>
    <strong>Path:new&nbsp;()</strong>
    </dt>
    <dd>
    Inits a new <a href="../modules/core.path.html">path</a> .


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local p = Path()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/core.path.html">path</a></span>
        a <a href="../modules/core.path.html">path</a>
    </ol>


</dd>
    <dt>
    <a name = "Path:iter"></a>
    <strong>Path:iter&nbsp;()</strong>
    </dt>
    <dd>
    Iterates on each single <a href="../modules/core.node.html">node</a>  along a <a href="../modules/core.path.html">path</a> .  At each step of iteration,
 returns the <a href="../modules/core.node.html">node</a>  plus a count value. Aliased as <a href="../modules/core.path.html#Path:nodes">Path:nodes</a>


    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 for node, count in p:iter() do
   ...
 end</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>
        <li>
          <span class="types"><a class="type" href="../modules/core.node.html">node</a></span>
        a <a href="../modules/core.node.html">node</a> </li>
        <li>
          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
        the count for the number of nodes</li>
    </ol>


    <h3>see also:</h3>
    <ul>
         <a href="../modules/core.path.html#Path:nodes">Path:nodes</a>
    </ul>
</dd>
    <dt>
    <a name = "Path:nodes"></a>
    <strong>Path:nodes&nbsp;()</strong>
    </dt>
    <dd>
    Iterates on each single <a href="../modules/core.node.html">node</a>  along a <a href="../modules/core.path.html">path</a> .  At each step of iteration,
 returns a <a href="../modules/core.node.html">node</a>  plus a count value. Alias for <a href="../modules/core.path.html#Path:iter">Path:iter</a>


    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 for node, count in p:nodes() do
   ...
 end	</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>
        <li>
          <span class="types"><a class="type" href="../modules/core.node.html">node</a></span>
        a <a href="../modules/core.node.html">node</a> </li>
        <li>
          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
        the count for the number of nodes</li>
    </ol>


    <h3>see also:</h3>
    <ul>
         <a href="../modules/core.path.html#Path:iter">Path:iter</a>
    </ul>
</dd>
    <dt>
    <a name = "Path:getLength"></a>
    <strong>Path:getLength&nbsp;()</strong>
    </dt>
    <dd>
    Evaluates the <a href="../modules/core.path.html">path</a>  length


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local len = p:getLength()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">number</span></span>
        the <a href="../modules/core.path.html">path</a>  length
    </ol>


</dd>
    <dt>
    <a name = "Path:addNode"></a>
    <strong>Path:addNode&nbsp;(node [, index])</strong>
    </dt>
    <dd>
    Counts the number of steps.
 Returns the number of waypoints (nodes) in the current path.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">node</span>
        <span class="types"><a class="type" href="../modules/core.node.html">node</a></span>
       a node to be added to the path</li>
      <li><span class="parameter">index</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the index at which the node will be inserted. If omitted, the node will be appended after the last node in the path.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">local nSteps = p:countSteps()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/core.path.html">path</a></span>
        self (the calling <a href="../modules/core.path.html">path</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Path:fill"></a>
    <strong>Path:fill&nbsp;()</strong>
    </dt>
    <dd>
    <a href="../modules/core.path.html#Class_Path">Path</a>  filling modifier.  Interpolates between non contiguous nodes along a <a href="../modules/core.path.html">path</a>
 to build a fully continuous <a href="../modules/core.path.html">path</a> . This maybe useful when using search algorithms such as Jump Point Search.
 Does the opposite of <a href="../modules/core.path.html#Path:filter">Path:filter</a>


    <h3>Usage:</h3>
    <ul>
        <pre class="example">p:fill()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/core.path.html">path</a></span>
        self (the calling <a href="../modules/core.path.html">path</a>  itself, can be chained)
    </ol>


    <h3>see also:</h3>
    <ul>
         <a href="../modules/core.path.html#Path:filter">Path:filter</a>
    </ul>
</dd>
    <dt>
    <a name = "Path:filter"></a>
    <strong>Path:filter&nbsp;()</strong>
    </dt>
    <dd>
    <a href="../modules/core.path.html#Class_Path">Path</a>  compression modifier.  Given a <a href="../modules/core.path.html">path</a> , eliminates useless nodes to return a lighter <a href="../modules/core.path.html">path</a> <br/>
 consisting of straight moves. Does the opposite of <a href="../modules/core.path.html#Path:fill">Path:fill</a>


    <h3>Usage:</h3>
    <ul>
        <pre class="example">p:filter()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/core.path.html">path</a></span>
        self (the calling <a href="../modules/core.path.html">path</a>  itself, can be chained)
    </ol>


    <h3>see also:</h3>
    <ul>
         <a href="../modules/core.path.html#Path:fill">Path:fill</a>
    </ul>
</dd>
    <dt>
    <a name = "Path:clone"></a>
    <strong>Path:clone&nbsp;()</strong>
    </dt>
    <dd>
    Clones a <a href="../modules/core.path.html">path</a> .


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local p = path:clone()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/core.path.html">path</a></span>
        a <a href="../modules/core.path.html">path</a>
    </ol>


</dd>
    <dt>
    <a name = "Path:isEqualTo"></a>
    <strong>Path:isEqualTo&nbsp;(p2)</strong>
    </dt>
    <dd>
    Checks if a <a href="../modules/core.path.html">path</a>  is equal to another.  It also supports <em>filtered paths</em> (see <a href="../modules/core.path.html#Path:filter">Path:filter</a>).

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">p2</span>
        <span class="types"><a class="type" href="../modules/core.path.html">path</a></span>
       a path</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">print(myPath:isEqualTo(anotherPath))</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">boolean</a></span>
        a boolean
    </ol>


</dd>
    <dt>
    <a name = "Path:reverse"></a>
    <strong>Path:reverse&nbsp;()</strong>
    </dt>
    <dd>
    Reverses a <a href="../modules/core.path.html">path</a> .


    <h3>Usage:</h3>
    <ul>
        <pre class="example">myPath:reverse()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/core.path.html">path</a></span>
        self (the calling <a href="../modules/core.path.html">path</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Path:append"></a>
    <strong>Path:append&nbsp;(p)</strong>
    </dt>
    <dd>
    Appends a given <a href="../modules/core.path.html">path</a>  to self.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">p</span>
        <span class="types"><a class="type" href="../modules/core.path.html">path</a></span>
       a path</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">myPath:append(anotherPath)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/core.path.html">path</a></span>
        self (the calling <a href="../modules/core.path.html">path</a>  itself, can be chained)
    </ol>


</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
